import { createStore } from 'vuex'
import http from '@/utils/http.js'

export default createStore({
  state: {
    centerData: [],
    UrlBase: 'http://localhost:3999/',
    routerMate: '',
  },
  getters: {
  },
  mutations: {
    GetCenterData (state, value) {
      state.centerData = value
    },
    GetRouterMate (state, value) {
      state.routerMate = value
    },
  },
  actions: {
    getCenterData (store) {
      http.get('/endIndex/center').then(res => {
        store.commit('GetCenterData', res.data.info)
      })
    },
    getRouterMate (store, value) {
      store.commit('GetRouterMate', value)
    },
  },
  modules: {
  }
})
